<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>注册结果</title>
</head>
<body>

<%
    // 从 session 中获取提示信息
    String error = (String) session.getAttribute("error");
    String success = (String) session.getAttribute("success");

    // 显示后清除属性，防止刷新重复显示
    session.removeAttribute("error");
    session.removeAttribute("success");
%>

<%
    if (error != null) {
%>
<p style='color: red;'>注册失败，<%= error %>。</p>
<%
} else if (success != null) {
%>
<p style='color: green;'><%= success %>。</p>
<a href="/chenweilong_war_exploded/Ans1/login.jsp">去登录</a>
<%
} else {
%>
<p>没有接收到任何注册结果信息。</p>
<%
    }
%>

<br>
<a href="register.jsp">返回注册页面</a>

</body>
</html>
